Skip to content

add zlua.ko module order to fix sym conflict#298

Merged
lneto merged 1 commit intoluainkernel:masterfrom
sheharyaar:fix/lua-sym-conflict
Jul 10, 2025
Merged

add zlua.ko module order to fix sym conflict#298
lneto merged 1 commit intoluainkernel:masterfrom
sheharyaar:fix/lua-sym-conflict

Conversation

@sheharyaar
Copy link
Copy Markdown
Member

No description provided.

@sheharyaar sheharyaar requested a review from lneto July 8, 2025 19:26
@sheharyaar
Copy link
Copy Markdown
Member Author

Let's give Shivam some time to test this change.

@marcelstanley
Copy link
Copy Markdown
Contributor

@ShivamVashisth28 FYI

@jperon
Copy link
Copy Markdown
Collaborator

jperon commented Jul 8, 2025

As discussed in Matrix, this fix won’t work after zfs 2.2.2:

root@shbox:/opt/lunatik# uname -a
Linux shbox 6.13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.13.9-1~exp1 (2025-03-29) x86_64 GNU/Linux
root@shbox:/opt/lunatik# apt policy zfs-dkms
zfs-dkms:
  Installé : 2.3.2-1
  Candidat : 2.3.2-1
root@shbox:/opt/lunatik# make
make -C /lib/modules/6.13-amd64/build M=/opt/lunatik CONFIG_LUNATIK=m	\
CONFIG_LUNATIK_RUN=m CONFIG_LUNATIK_RUNTIME=y CONFIG_LUNATIK_DEVICE=m	\
CONFIG_LUNATIK_LINUX=m CONFIG_LUNATIK_NOTIFIER=m CONFIG_LUNATIK_SOCKET=m \
CONFIG_LUNATIK_RCU=m CONFIG_LUNATIK_THREAD=m CONFIG_LUNATIK_FIB=m \
CONFIG_LUNATIK_DATA=m CONFIG_LUNATIK_PROBE=m CONFIG_LUNATIK_SYSCALL=m \
CONFIG_LUNATIK_XDP=m CONFIG_LUNATIK_FIFO=m CONFIG_LUNATIK_XTABLE=m \
CONFIG_LUNATIK_NETFILTER=m CONFIG_LUNATIK_COMPLETION=m \
CONFIG_LUNATIK_CRYPTO_SHASH=m CONFIG_LUNATIK_CRYPTO_SKCIPHER=m
make[1] : on entre dans le répertoire « /usr/src/linux-headers-6.13-amd64 »
make[2] : on entre dans le répertoire « /opt/lunatik »
  AS      klibc/usr/klibc/arch/x86_64/setjmp.o
  LD [M]  lunatik.o
lunatik.o: warning: objtool: luaV_execute+0x76: sibling call from callable instruction with modified stack frame
  MODPOST Module.symvers
  LD [M]  lunatik.ko
  BTF [M] lunatik.ko
make[2] : on quitte le répertoire « /opt/lunatik »
make[1] : on quitte le répertoire « /usr/src/linux-headers-6.13-amd64 »
root@shbox:/opt/lunatik# make install
mkdir -p -m 0755 /lib/modules/lua /lib/modules/lua/lunatik
mkdir -p -m 0755 /lib/modules/lua /lib/modules/lua/socket
mkdir -p -m 0755 /lib/modules/lua /lib/modules/lua/syscall
mkdir -p -m 0755 /lib/modules/lua /lib/modules/lua/crypto
install -o root -g root -m 0644 driver.lua /lib/modules/lua/
install -o root -g root -m 0644 lib/mailbox.lua /lib/modules/lua/
install -o root -g root -m 0644 lib/net.lua /lib/modules/lua/
install -o root -g root -m 0644 lib/util.lua /lib/modules/lua/
install -o root -g root -m 0644 lib/lunatik/*.lua /lib/modules/lua/lunatik
install -o root -g root -m 0644 lib/socket/*.lua /lib/modules/lua/socket
install -o root -g root -m 0644 lib/syscall/*.lua /lib/modules/lua/syscall
install -o root -g root -m 0644 lib/crypto/*.lua /lib/modules/lua/crypto
install -o root -g root -m 0755 bin/lunatik /usr/local/sbin
mkdir -p -m 0755 /lib/modules/6.13-amd64/kernel/lunatik
install -o root -g root -m 0644 *.ko lib/*.ko /lib/modules/6.13-amd64/kernel/lunatik
for mod in lunatik/lunatik.ko kernel/zfs/zfs.ko kernel/zfs/zlua.ko ; do \
	grep -qxF "$mod" /lib/modules/6.13-amd64/modules.order || echo "$mod" >> /lib/modules/6.13-amd64/modules.order; \
done
depmod -a
root@shbox:/opt/lunatik# lunatik
modprobe: ERROR: could not insert 'luadevice': Exec format error
modprobe: ERROR: could not insert 'lualinux': Exec format error
modprobe: ERROR: could not insert 'luanotifier': Exec format error
modprobe: ERROR: could not insert 'luasocket': Exec format error
modprobe: ERROR: could not insert 'luarcu': Exec format error
modprobe: ERROR: could not insert 'luathread': Exec format error
modprobe: ERROR: could not insert 'luafib': Exec format error
modprobe: ERROR: could not insert 'luadata': Exec format error
modprobe: ERROR: could not insert 'luaprobe': Exec format error
modprobe: ERROR: could not insert 'luasyscall': Exec format error
modprobe: ERROR: could not insert 'luaxdp': Exec format error
modprobe: ERROR: could not insert 'luafifo': Exec format error
modprobe: ERROR: could not insert 'luaxtable': Exec format error
modprobe: ERROR: could not insert 'luanetfilter': Exec format error
modprobe: ERROR: could not insert 'luacompletion': Exec format error
modprobe: ERROR: could not insert 'luacrypto_shash': Exec format error
modprobe: ERROR: could not insert 'luacrypto_skcipher': Exec format error
modprobe: ERROR: could not insert 'lunatik_run': Exec format error
/usr/bin/lua5.4: /usr/local/sbin/lunatik:61: couldn't create /dev/lunatik
stack traceback:
	[C]: in function 'error'
	/usr/local/sbin/lunatik:61: in field 'load'
	/usr/local/sbin/lunatik:101: in main chunk
	[C]: in ?

Dmesg:

juil. 08 23:17:49 shbox kernel: zfs: exports duplicate symbol luaL_argerror (owned by lunatik)

@sheharyaar
Copy link
Copy Markdown
Member Author

@jperon , according to the conversation at Matrix, can you please check the location of the module zfs-dkms. I suspect that the location will be different as mention in the Makefiles (kernel/zfs/zfs.ko).

If that is the case, we need to add this as well.
Or we can use find to find all the occurrences of zfs.ko and zlua.ko.

But first, we need the confirmation from you regarding the path.

Comment thread Makefile Outdated
Copy link
Copy Markdown
Collaborator

@jperon jperon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiled and run without any error.

@sheharyaar sheharyaar force-pushed the fix/lua-sym-conflict branch 2 times, most recently from fd0a1a7 to 702dc9c Compare July 9, 2025 18:16
@sheharyaar
Copy link
Copy Markdown
Member Author

@jperon can you please test the new one that I pushed ?

Signed-off-by: Mohammad Shehar Yaar Tausif <sheharyaar48@gmail.com>
@sheharyaar sheharyaar force-pushed the fix/lua-sym-conflict branch from 702dc9c to 6ae9356 Compare July 9, 2025 18:32
@sheharyaar
Copy link
Copy Markdown
Member Author

I tested on Ubuntu 22.04 with kernel version: 5.15.0-91

  • the latest changes work with both normal and dkms zfs modules.
  • lunatik builds fine

@lneto lneto merged commit 3befc7b into luainkernel:master Jul 10, 2025
1 check passed
@sheharyaar sheharyaar deleted the fix/lua-sym-conflict branch July 10, 2025 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants